home *** CD-ROM | disk | FTP | other *** search
-
- /********************************************
- **** Animation Class Library V1.0 © 1994 Yves Schmid & Alia Development
- ****
- **** AnimMask.h
- ****
- **** Created: 02 June 1994
- **** Modified: 02 September 1994
- **** Version: 0
- **** Compatible: C++, Mac System 7
- ****
- **** Description: AnimMask is a special kind of animation which allows you to
- **** mask other animation objects.
- ****
- **** AnimMask is a child class of the AnimCObject class.
- ****
- *******************/
-
- #ifndef AnimMask_H
- #define AnimMask_H
-
-
- #include "AnimCObject.h"
- #include "AnimGfx.h"
-
- class AnimBase;
-
- class AnimMask: public AnimCObject
- {
-
- //***********************************************************
- //.............. P U B L I C M E T H O D S.................
-
- public:
-
-
- // Datas passed are copied, so you don't have to keep them in memory.
-
- AnimMask(AnimSupervisor *base, long resID); // Initializes with a PICT resource
- AnimMask(AnimSupervisor *base, AnimGfx *agfx); // Initializes with an AnimGfx object
- AnimMask(AnimSupervisor *base); // Empty mask
-
- ~AnimMask(void);
-
-
- // Datas passed are copied, so you don't have to keep them in memory.
-
- void setmask(long resID); // Installs with a PICT resource
- void setmask(AnimGfx *agfx); // Installs with an AnimGfx object
- void purge(void); // The mask bitmap is deleted
-
-
- void findmaxsize(short *width, short *height) const; // Finds the maximum pixels size of the
- // object.
- // You can pass NULL pointers.
-
- void findcursize(short *width, short *height); // Finds the maximum pixels size of the
- // object in his current state.
- // You can pass NULL pointers.
-
- void findcurrect(Rect *rect); // Finds the visual rect of the
- // object in his current state.
-
- // Gets/sets mask offset
-
- inline short getoffsetx(void) const {return offsetx;}
- inline short getoffsety(void) const {return offsety;}
-
- inline void setoffsetx(const short x) {offsetx = x;}
- inline void setoffsety(const short y) {offsety = y;}
-
-
- //***********************************************************
-
- //..........................................................
- // You should not call the following methods!
-
- Boolean draw(short basex =0, short basey =0);
- virtual void getcollisionmask(BitMap **b, unsigned long **linemask, Rect *);
-
- //..........................................................
-
- private:
-
- BitMap *bitmap;
- unsigned long *linemask;
- short offsetx,offsety;
-
-
- void setmask(BitMap *bitmap,
- unsigned long *linemask);
-
- };
-
-
- #endif
-
-